tmem: Fix uses of unmatched __map_domain_page()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 6 Dec 2013 15:09:38 +0000 (16:09 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Dec 2013 15:09:38 +0000 (16:09 +0100)
commit2f718161bc292bfbdf1aeefd3932b73c0965373d
tree61bf55860bd450e59f8264c9b5d51c77d45c9c12
parentcc9a0f989f04f01c59c5d90748092811a760bd84
tmem: Fix uses of unmatched __map_domain_page()

__map_domain_page() *must* be matched with an unmap_domain_page().  These five
static inline functions each map a page (or two), then throw away the context
needed to unmap it.

Each of the changes are limited to their respective functions.  In two cases,
this involved replacing a large amount of pointer arithmetic with memcpy()
(all callers were relying on memcpy() semantics of positive/negative returns
rather than specifically -1/+1). A third case had its pointer arithmetic
entirely replaced with memcpy().

In addition, remove redundant casts of void pointers and assertions.

This fixes Coverity IDs 1135373 1135374 1135375 1135376 1135377 1135378
11353739 which were retroactively identified following modelling improvements.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Bob Liu <bob.liu@oracle.com>
xen/include/xen/tmem_xen.h